<?php
/*
 *  FireFly theme
 *  Comments template
 *  (c) 2011, chugylo
 */
?>
<?php if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die (__('Please do not load this page directly. Thanks!', 'firefly'));
if (post_password_required()) return; ?>
            <div id="comments">
                <h3><?php _e('Comments', 'firefly');
                $comments_number = firefly_get_comments_number();
                if ($comments_number >= 0) {
                    echo ' (';
                    echo $comments_number;
                    echo ')';
                } ?><span class="comments-feed"><a href="<?= get_post_comments_feed_link(); ?>"><img src="<?php echo get_template_directory_uri() ."/images/feed-30px.png"; ?>" alt="<?php _e('Comments feed', 'firefly'); ?>" title="<?php _e('Comments feed', 'firefly'); ?>" width="15" height="15" /></a></span></h3><a name="comments"></a>
                <?php
                if (!comments_open()) : ?>
                <p class="closed_comments"><?php _e('Comments are closed.', 'firefly'); ?></p>
                <?php
                endif;
                if (have_comments()) :
                if (!empty($comments_by_type['comment'])) :
                if (get_comment_pages_count() > 1 && get_option('page_comments' )) : ?>
                <div class="navigation">
                    <div class="nav-previous"><?php previous_comments_link(__( '<span class="meta-nav">&larr;</span> Older Comments', 'firefly')); ?></div>
                    <div class="nav-next"><?php next_comments_link(__( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'firefly' )); ?></div>
                </div>
                <?php endif; // check for comment navigation ?>
                <ol>
                    <?php wp_list_comments(sprintf('type=comment&replay_text=%s&login_text=%s', __('Reply', 'firefly'), __('Log in to Reply', 'firefly'))); ?>
                </ol><?php endif; endif; // end comment loop
                if (get_comment_pages_count() > 1 && get_option('page_comments' )) : ?>
                <div class="navigation">
                    <div class="nav-previous"><?php previous_comments_link(__( '<span class="meta-nav">&larr;</span> Older Comments', 'firefly')); ?></div>
                    <div class="nav-next"><?php next_comments_link(__( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'firefly' )); ?></div>
                </div>
                <?php endif; // check for comment navigation ?>
            </div><!--end comments-->
            <?php if (!empty($comments_by_type['pings'])) : ?>
            <div id="pings">
                <h3><?php _e('Trackbacks & Pingbacks', 'firefly'); ?></h3>
                <ol>
                    <?php wp_list_comments('type=pings&callback=list_pings'); ?>
                </ol>
            </div>
            <?php endif; ?>
            <?php if (comments_open()) : ?>
            <?php if (get_option('comment_registration') && !$user_ID ) : ?>
            <p class="comments-blocked"><?php _e('You have to ', 'firefly'); ?><a href="<?= site_url(); ?>/wp-login.php?redirect_to=
            <?php the_permalink(); ?>"><?php _e('sign in', 'firefly'); ?></a><?php _e(' to comment.', 'firefly'); ?></p>
            <?php else : ?>
            <div id="write-comment">
                <?php comment_form(); ?>
            </div><!--end write-comment-->
            <?php endif; endif; // end registration; end comments_open ?>